import type {PageParam, PageResult} from '@vben/request';
import type {Dayjs} from 'dayjs';

import {requestClient} from '#/api/request';
export namespace PerFamilyFinancialApi {
  /** 金融理财情况信息 */
  export interface FamilyFinancial {
    id: number; // 主键ID
    employeeId: number; // 人员ID，对应 per_employee.id
    relation: string; // 与本人关系（称谓）
    systemPersonId: number; // 系统人员ID，对应 system_person.id
    familyName: string; // 家庭成员姓名
    cardType: string; // 证件类型
    familyIdcard: string; // 家庭成员身份证号
    productName: string; // 产品名称
    holdingAmount: string; // 持有份额
    marketValue: number; // 当前市值
    recordDate: string; // 记录时间
    status: number; // 是否有效（1：有效，0：无效）
  }
}

/** 查询金融理财情况分页 */
export function getFamilyFinancialPage(data: PageParam,desensitize: boolean,encrypt: boolean) {
  return requestClient.post<PageResult<PerFamilyFinancialApi.FamilyFinancial>>('/per/family-financial/page', data,{ desensitize,encrypt });
}

/** 查询金融理财情况详情 */
export function getFamilyFinancial(id: number) {
  return requestClient.get<PerFamilyFinancialApi.FamilyFinancial>(`/per/family-financial/get?id=${id}`);
}

/** 新增金融理财情况 */
export function createFamilyFinancial(data: PerFamilyFinancialApi.FamilyFinancial) {
  return requestClient.post('/per/family-financial/create', data);
}

/** 修改金融理财情况 */
export function updateFamilyFinancial(data: PerFamilyFinancialApi.FamilyFinancial) {
  return requestClient.put('/per/family-financial/update', data);
}

/** 删除金融理财情况 */
export function deleteFamilyFinancial(id: number) {
  return requestClient.delete(`/per/family-financial/delete?id=${id}`);
}

/** 批量删除金融理财情况 */
export function deleteFamilyFinancialList(ids: number[]) {
  return requestClient.delete(`/per/family-financial/delete-list?ids=${ids.join(',')}`)
}

/** 导出金融理财情况 */
export function exportFamilyFinancial(params: any) {
  return requestClient.download('/per/family-financial/export-excel', { params });
}
